package com.xiangyueEducation.uploaderCloud.controller;


import com.xiangyueEducation.uploaderCloud.mq.u2uChat.CreateQueueUtils;
import com.xiangyueEducation.uploaderCloud.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@Slf4j
@RequestMapping("/test")
public class MyTest {

    @Autowired
    CreateQueueUtils utils;

    @GetMapping("a")
    public Result<?> ok(){
        return Result.ok("欢迎ycy");
    }

    @GetMapping("/logTest")
    public Result test(){
        log.info("测试成功");
        throw new RuntimeException();
//        return Result.ok("测试成功");
    }

    @RequestMapping("createQueue")
    public Result createQueue(){
        utils.bindU2UQueue(4332432L);
        return Result.ok("创建队列成功");
    }

}
